package com.FileClass;

import java.io.*;
/**
 * 不停的读取文件 到byte数组，这样可以比对 两个大文件分段比较md5
 *
 * 这就是简单的file 复制粘贴，buffer数组 Jdk默认为8192
 */
public class ReadFile {
    public static void main(String[] args) throws FileNotFoundException, IOException {


        FileInputStream fileInputStream = new FileInputStream("D:\\Jianyin\\Captures\\合并.mp3");
        //jdk Files类默认的 buffer_size 8192
        byte[] buf = new byte[8192];
        int len;
        int sum =0;
        FileOutputStream outputStream = new FileOutputStream("D:\\Jianyin\\Captures\\删除.mp3");
        while( (len = fileInputStream.read(buf)) != -1) {
            outputStream.write(buf);
            sum += len;
        }


    }
}






































